package com.shiro.web.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shiro.web.dao.MyBatisDao;
import com.shiro.web.model.User;

@Service
public class UserService {

	@Autowired
	private MyBatisDao myBatisDao;
	
	public int register(User user) {
		return myBatisDao.save("UserMapper.register", user);
	}
	
	public User findUserByName(String username) {
		return myBatisDao.get("UserMapper.get", username);
	}

	public List<User> query() {
		return myBatisDao.getList("UserMapper.query");
	}
}
